import { useState} from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import CreateOrder from '../components/CreatOrder' ;
import ProForm, {ProFormText} from '@ant-design/pro-form';
import '../components/index.css'

const PayType = () => {
  // 定义Form实例，用来操作表单
  const [formObj] = ProForm.useForm();
  const [initialValues,setInitialValues] = useState(undefined)
  const setDetails = content => formObj.setFieldsValue({'details':content});

  return (
    <PageContainer>
      <ProForm
        form={formObj}
        initialValues={initialValues}
      >
        <ProFormText
          name='name'
          label='协议名称'
          value='付费会员协议'
        >
        </ProFormText>

        <ProForm.Item
          name='details'
          label='协议内容'
        >
          <CreateOrder
            setDetails={setDetails}
            content={initialValues === undefined ? '' : initialValues.details}
          />
        </ProForm.Item>
      </ProForm>

    </PageContainer>
  );
};

export default PayType;
